#ifndef ADDGRABTNDIALOG_H
#define ADDGRABTNDIALOG_H

#include <QtGui/QDialog>
#include <QtGui/QLineEdit>
#include <QtGui/QGroupBox>
#include <QtGui/QComboBox>
#include <QtGui/QListWidget>
#include <QtGui/QDialogButtonBox>

#include <QtSql/QSqlTableModel>

#include "graphicbutton.h"

class AddGraBtnDialog : public QDialog
{
    Q_OBJECT
public:
    explicit AddGraBtnDialog(QWidget *parent = 0);

signals:

public slots:
    void add_btn_clicked();
    void cancel_btn_clicked();


private:
    //编辑区域
    QGroupBox *edit_groupbox;
    QLabel *district_label;
    QLabel *building_label;
    QLabel *layer_label;
    QLabel *room_label;
    QLineEdit *district;
    QLineEdit *building;
    QLineEdit *layer;
    QLineEdit *room;
    QLabel *device_name_label;
    QComboBox *device_name_combox;

    //预览区域
    QGroupBox *preview_area;
    GraphicButton *preview_btn;

    //提示区域
    QGroupBox *help_groupbox;
    QListWidget *help_list;

    //按钮区域
    QPushButton *add_btn;
    QPushButton *cancel_btn;
    QPushButton *close_btn;
    QDialogButtonBox *button_box;

    QSqlTableModel *table_model;

private:
    void create_three_groupbox();
    bool input_valid(QString &dis, QString &buil, QString &layer, QString &room);

};

#endif // ADDGRABTNDIALOG_H
